﻿using Glorysoft.EAP.Core;
using Glorysoft.EAP.EAPClient.Model;
using Glorysoft.EAP.EAPClient.ViewModel;
using System;
using System.Collections.Generic;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Shapes;

namespace Glorysoft.EAP.EAPClient
{
    /// <summary>
    /// AdminLogin.xaml 的交互逻辑
    /// </summary>
    public partial class AdminLogin : Window
    {
        public AdminLogin()
        {         
           InitializeComponent();
            this.DataContext = new LoginViewModel();
            WindowStartupLocation = WindowStartupLocation.CenterOwner;
            this.Topmost = true;
            Rect rc = SystemParameters.WorkArea;//获取工作区大小 
            this.Left = (rc.Width) * 4 / 6;//设置位置 
            this.Top = (rc.Height) / 3;
           
            LoginViewModel.Loginpassword = string.Empty;
        }
        private void Window_Loaded_login(object sender, RoutedEventArgs e)
        {
            var NeedleMaterialType = "";
            if (Dict.Current.NeedleMaterial == "1")
            {
                NeedleMaterialType = RunService.Current.EQPInfo.NeedleMaterialType1;//金针
            }
            else
            {
                NeedleMaterialType = RunService.Current.EQPInfo.NeedleMaterialType2;//铼钨针
            }
            NeedleMarkMessage.ItemsSource = NeedleMaterialType.Split(';');
            NeedleMarkMessage.SelectedIndex = 0;//默认显示第一个选片模式

        }
        private void CloseWindowButton_Click(object sender, RoutedEventArgs e)
        {
            this.Close();
        }
        //private void Win_Closed(object sender, EventArgs e)
        //{
        //    Application.Current.Windows[0].Effect = null;
        //}
        private void Image_MouseLeave(object sender, MouseEventArgs e)
        {
            this.txtPassWord.Visibility = Visibility.Collapsed;
        }

        private void Image_MouseMove(object sender, MouseEventArgs e)
        {
            this.txtPassWord.Visibility = Visibility.Visible;
            this.txtPassWord.Text = LoginViewModel.Loginpassword;
        }
       

    }
}
